# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=snac
pkgver=2.52
pkgrel=0
pkgdesc="Simple, minimalistic ActivityPub instance written in portable C"
url="https://codeberg.org/grunfink/snac2"
arch="all"
license="MIT"
makedepends="curl-dev openssl-dev"
install="$pkgname.pre-install"
pkgusers="snac"
pkggroups="snac"
subpackages="$pkgname-doc $pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://codeberg.org/grunfink/snac2/archive/$pkgver.tar.gz
	snac.initd
	"
builddir="$srcdir/snac2"
options="!check" # no test suite

build() {
	make
}

package() {
	make install \
		PREFIX="$pkgdir"/usr \
		PREFIX_MAN="$pkgdir"/usr/share/man

	install -dm750 -o snac -g snac "$pkgdir"/var/lib/snac

	install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/

	install -Dm755 "$srcdir"/snac.initd "$pkgdir"/etc/init.d/snac
}

sha512sums="
82a22bb940fb46d0ce2f06a4140439eacb66ca0e066180bbe797a0ada86d99d98aef22fd4067e67f8fc2f617c9a66c371b779cf1862f9452b50bca4e8b1697b1  snac-2.52.tar.gz
8451eb37e5135b926a1a36b7f69d63cb76aa617ca3f9b9167f2284223582dcf66723ee67c51c6abc2d1605c41678d26f67ec6cb1bf920c61379dbf63f7852e1a  snac.initd
"
